<?php
namespace Osp\UserBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;
use Doctrine\Common\Collections\ArrayCollection; 

/** 
* @ORM\Entity 
* @ORM\Entity(repositoryClass="Osp\UserBundle\Entity\UserRepository")
*/
class User implements UserInterface
{ 
	/** 
	* @ORM\Id 
	* @ORM\Column(name="id", type="integer") 
	* @ORM\GeneratedValue(strategy="AUTO") 
	*/
	private $id;

    /** 
    * @ORM\Column(name="username", type="string", length=255, unique=true) 
    */ 
    private $username;

    /** 
    * @ORM\Column(name="password", type="string", length=255) 
    */ 
    private $password;

    /**
    * @ORM\Column(name="salt", type="string", length=255)
    */
    private $salt;   

	/** 
	* @ORM\Column(name="roles", type="array") 
	*/ 
	private $roles;

	/** 
	* @ORM\Column(name="nom", type="string", length=50) 
	*/ 
	private $nom;

    /** 
    * @ORM\Column(name="prenom", type="string", length=50) 
    */ 
    private $prenom;

    /** 
    * @ORM\Column(name="adresse", type="string", length=255) 
    */ 
    private $adresse;

	/** 
	* @ORM\Column(name="codePostal", type="string", length=5) 
	*/  
	private $codePostal;

    /** 
    * @ORM\Column(name="ville", type="string", length=100) 
    */ 
    private $ville;

    /** 
    * @ORM\Column(name="email", type="string", length=255) 
    */ 
    private $email;

    /** 
    * @ORM\Column(name="telephone", type="string", length=20) 
    */ 
    private $telephone;


    public function __construct()
    {
        $this->roles = array();
    }

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set username
     *
     * @param string $username
     * @return User
     */
    public function setUsername($username)
    {
        $this->username = $username;
    
        return $this;
    }

    /**
     * Get username
     *
     * @return string 
     */
    public function getUsername()
    {
        return $this->username;
    }

    /**
     * Set password
     *
     * @param string $password
     * @return User
     */
    public function setPassword($password)
    {
        $this->password = $password;
    
        return $this;
    }

    /**
     * Get password
     *
     * @return string 
     */
    public function getPassword()
    {
        return $this->password;
    }


    /**
     * Set salt
     *
     * @param string $salt
     * @return User
     */
      public function setSalt($salt)
    {
        $this->salt = $salt;
        return $this;
    }

    /**
     * Get salt
     *
     * @return string 
     */
    public function getSalt()
    {
        return $this->salt;
    }


    /**
     * Set roles
     *
     * @param integer $roles
     * @return User
     */
    public function setRoles($roles)
    {
        $this->roles = $roles;
    
        return $this;
    }

    public function getRoles()
    {
        return (array)$this->roles;
    }

    public function getRolesString()
    {
        return $this->roles;
    }
    

    /**
     * Set nom
     *
     * @param string $nom
     * @return User
     */
    public function setNom($nom)
    {
        $this->nom = $nom;
    
        return $this;
    }

    /**
     * Get nom
     *
     * @return string 
     */
    public function getNom()
    {
        return $this->nom;
    }
    
    /**
     * Set prenom
     *
     * @param string $prenom
     * @return User
     */
    public function setPrenom($prenom)
    {
        $this->prenom = $prenom;
    
        return $this;
    }

    /**
     * Get prenom
     *
     * @return string 
     */
    public function getPrenom()
    {
        return $this->prenom;
    }

    /**
     * Set adresse
     *
     * @param string $adresse
     * @return User
     */
    public function setAdresse($adresse)
    {
        $this->adresse = $adresse;
    
        return $this;
    }

    /**
     * Get adresse
     *
     * @return string 
     */
    public function getAdresse()
    {
        return $this->adresse;
    }

    /**
     * Set codepostal
     *
     * @param string $codepostal
     * @return User
     */
    public function setCodePostal($codePostal)
    {
        $this->codePostal = $codePostal;
    
        return $this;
    }

    /**
     * Get codepostal
     *
     * @return string 
     */
    public function getCodePostal()
    {
        return $this->codePostal;
    }

    /**
     * Set ville
     *
     * @param string $ville
     * @return User
     */
    public function setVille($ville)
    {
        $this->ville = $ville;
    
        return $this;
    }

    /**
     * Get ville
     *
     * @return string 
     */
    public function getVille()
    {
        return $this->ville;
    }

    /**
     * Set email
     *
     * @param string $email
     * @return User
     */
    public function setEmail($email)
    {
        $this->email = $email;
    
        return $this;
    }

    /**
     * Get email
     *
     * @return string 
     */
    public function getEmail()
    {
        return $this->email;
    }

    /**
     * Set telephone
     *
     * @param string $telephone
     * @return User
     */
    public function setTelephone($telephone)
    {
        $this->telephone = $telephone;
    
        return $this;
    }

    /**
     * Get telephone
     *
     * @return string 
     */
    public function getTelephone()
    {
        return $this->telephone;
    }

    public function eraseCredentials()
    {
    }
   
}